#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#define MAX 100000
int main() {
	static char a[MAX];
    const char c[]="ASDF";//根据需要修改
	char b[10];
	long long n, i, j = 0;

	scanf("%lld", &n);
	scanf("%s", a);

	for (i = 0; i < n; i++) {
        //根据需要修改
		if (a[i] >= 'A' && a[i] <= 'Z') {
			b[j] = a[i];
			j++;
		}
	}
	b[j] = '\0';

	int ret = strcmp(c, b);
	if ((int)strlen(b) == (int)strlen(c) && ret == 0) {
		printf("YES\n");
	}
	else {
		printf("NO\n");
	}
	
	return 0;
}